<template>
  <div>
      <h1 class="h1">我是获取路由参数组件</h1>
      <p>此页面使用props获取路由的参数</p>
      <p>name参数：{{name}}</p>
      <p>age参数：{{age}}</p>
  </div>
</template>

<script>
export default {
    name: "ComProps",
    props: [
        "name","age"
    ],
    watch: {
        name: {
            immediate: true,
            handler(newVal,oldVal) {
                console.log("新传入值：",newVal)
            }
        }
    }
}
</script>

<style scoped>
    .h1 {
        color: #f00;
    }
</style>
